home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
CLOCKWRK.ARJ
/
CWK41.DOC
< prev
Wrap
Text File
|
1991-05-03
|
18KB
|
321 lines
>>CLOCKWORK<< ver. 4.1, May 1991
Automatically maintains super accurate system clock without modem
and long distance calls or any other costly harware.
Copyright (c) 1991 by Pavel Otavsky
26 Barberry Hill, Woodstock, Vermont 05091-1269
CLOCKWORK consists of two files: CWK41.DOC and CWK.EXE.
MAIN FEATURES
1. Clock accuracy measurement and automatic adjustment during
startup or as required.
2. Clock adjustment by entering the difference between the exact
time and the system clock.
3. Switch between Daylight Saving, Standard, Universal and Local
Meridian Time.
4. Change of time zone if crossing zone lines or change of date
if crossing the date line.
5. Calendar display with Julian day number, day of the week for
any date.
6. Days between dates calculator.
7. Menu selection and and question-answer system for entering
setup information, display control, clock adjustment,
utilities and system mode.
8. No interference with any system activity. It is not a memory
resident program, is easy to install and handle.
VERSION 4.1 VS. OLDER VERSIONS
Version 4.1 is provided for the first time with a menu
system and more than twice as many features as v. 3.3. Some of
the new ones are: Universal time, Local Meridian time, 4 modes
for the system clock, mode switching, automatic clock adjustment
from main program on both types of systems, setup for time zone
and local meridian and storing of commands for retreiving of time
on type 1 systems, travel functions (time zone change, etc.).
After automatic adjustment the announcement includes the amount
of adjustment.
Version 4.0 had a toggle between Daylight and Standard
Time, days between dates calculator, allowed automatic adjustment
from main screen (type 2 only) and the amount of adjustment could
be entered in any unit of time. A new algorithm was used that
handles correctly large differences between the add-on battery
and system clock (type 1). Version 4.0 has to use a new data file
(default names CWK1DATA.DAT and CWK2DATA.DAT) to store
information about the clock and therefore became non-compatible
with 3.3 or earlier.
An option of inspecting the data file was added in 3.3.
CWK1.EXE and CWK2.EXE were combined into one, CWK.EXE with
command line selection between type 1 and type 2 system. An
option was created then to place the data file anywhere in the
system and name it other than default names. The program
automatically creates the data file when used the first time.
The Automatic Clock Adjustment version 1.0 consisted of
seven files and the installation was much more complicated.
UPGRADE TO VERSION 4.1
If you want to keep the old adjustment factor, TYPE or
PRINT the old data file (CLOCDAT?.DAT) and note the integer part
of the third number in the file. (Or view the data file from the
program if you have a later version.) Copy the new CWK.EXE from
the distribution disk to the CLOCWORK subdirectory. You may keep
the existing setup. Run AUTOEXEC or reboot, change to CLOCWORK
directory, start the program (CWK 1 or CWK 2), change Mode to
Daylight if applicable, adjust the clock, start a new clock
measurement cycle and fill in the original adjustment factor. A
new data file will be created with the new default name. However
version 4.1 permits a simplified setup as described below.
INTRODUCTION
Every clock's speed is different from standard. If the
clock speed is known and remains constant, it is possible to
adjust it at any time and maintain a very high degree of
accuracy. The clock speed can be determined quite accurately if
the measurement is averaged over a long time. In the relatively
mild environment of a home or office computer, the clock speed
fluctuations are small. Therefore it is possible to apply
corrections at convenient times and achieve average accuracy much
better than that of clocks normally offered on computer systems.
The CLOCKWORK utility uses this principle to correct the system
clock. It does it automatically at startup if invoked by the
AUTOEXEC.BAT or at any other time if run manually or called by
some other program that might be run regularly.
SUGGESTED SETUP
There are two types of system clocks commonly used: one
is an add-on (on an I/O board, or memory board) usually on a
PC/XT or compatible, the other is integral, usually on a PC/AT or
compatible. The first type clock requires a software utility to
set (e.g. SETCLOCK.COM) and to retrieve in order to provide time
and date for the system when starting up (e.g. GETCLOCK.COM). The
second type is simply set and retrieved by the DOS commands
directly and does not require any special action when booting up.
In order to test for the type of clock on a given system,
change the DATE using the DOS routine. Reboot the system and note
whether the date change was permanent. If the change is not
permanent, the system is type 1. If the change is permanent, it
is system type 2.
To install CLOCKWORK, copy CWK.EXE to a utility
subdirectory (e.g. CLOCWORK ). That is where you may already have
the clock setting and retrieving programs used on type 1 system.
Then edit the AUTOEXEC.BAT file so that it contains this line for
system type 1 (PC/XT or compatibles):
...
\clocwork\cwk 1a \clocwork\cwk1data.dat
...
Then run the program "cwk 1" and select menu Setup and
then C. This allows entering the command used to retrieve the
battery clock. (It may be "GETCLOCK" "QUADCLOC" or something like
it.) Enter the command, including the PATH, e.g.
\clocwork\getclock . While editing the AUTOEXEC.BAT you can also
delete the clock retrieving command. It is stored in the
CWK1DATA.DAT and will be used by CLOCKWORK.
For system type 2 (PC/AT or compatibles):
...
\clocwork\cwk 2a \clocwork\cwk2data.dat
...
That completes the setup.
Note that no special command for retrieving the clock is
used on type 2 systems. "\clocwork\cwk " calls the program
regardless of what the current directory is. "1a " or "2a "
defines that it is system 1 or 2 and the automatic adjustment is
desired. "\clocwork\cwk1data.dat" is the path and name of the
auxiliary data file. If a different name is used here, you have
to use it every time in starting the program. cwk1data.dat or
cwk2data.dat are the defaults.
If the AUTOEXEC.BAT is run after the installation, a
message says that the clock has been adjusted. However, until the
clock adjustment factor has been measured, the adjustment amount
remains zero. The program always looks for the auxiliary data
file and creates it in the DOS current directory if it does not
exist. It is important to change to the CLOCWORK directory,
because the data file would be created again if started from a
different DOS current directory, unless the data file naming
option is used as shown above.
COMMAND LINE FORMAT
The command line format for CLOCKWORK is as follows:
CWK {1|1a|2|2a} [filespec]
{|} One of the first four arguments must be always used. CWK 1
will start the programfor type 1 systems. CWK 1a will perform
the automatic clock adjustment, changing the system clock by
an amount calculated from data stored previously. CWK 2 will
start the program for system type 2 and CWK 2A will perform
the automatic adjustment on type 2 systems.
[ ] The optional filespec can be drive, path and file name (e.g.
a:\clockdir\clocdata.dat), or only path and file name or only
file name. This option permits placing the data file
independently of the program. If no filespec is given, the
default is CWK1DATA.DAT or CWK2DATA.DAT, respectively, placed
in the current directory. If this option is required, care
and consistency in subsequent use is essential.
CLOCK ACCURACY MEASUREMENT
To measure the clock accuracy it is necessary to use
CWK.EXE to compare the system clock to a standard and adjust the
system clock at least twice, the best with an interval of several
days. The first time will be the beginning of the measurement
cycle, the second time will be when the clock adjustment factor
is calculated.
When the program is running, the command line is echoed
at the top of the display box, with the indication of system time
mode (Standard, Daylight, Universal or Local - selectable under
Mode menu heading).
The offset between the system time and adjusted display
is initially zero, and can be entered in different units after
hitting the E key. Direction keys are enabled to select
increments and accumulate them. Also any of the other time modes
can be selected and the display will run with the appropriate
offset.
The display can be frozen by using SPACE or F and
restarted by hitting any key. This provides high accuracy in
comparing the display to a time signal.
Change to Clock menu and use the F1 function to adjust
the system clock. The program beeps after adjusting the system
clock. F1 makes the adjustment count as a clock correction, F4 as
a sort of time zone change. F4 change has no effect on adjustment
factor calculation. Dates outside the legal DOS range cannot be
accepted by either F1 or F4. The program accumulates repeated
adjustments.
When the system clock is correctly adjusted, you can
start measuring its accuracy: F5 is used to indicate the start of
measurement cycle. Since the clock accuracy can be measured with
adjustments in effect, there is a provision for a manual input of
adjustment factor. Now you can select the Quit menu and exit the
program.
Some time later (days) adjust the display again according
to your reliable time signal, adjust the system with F1 and then
use F8. It is the complement to F5. It is used to complete the
measurement cycle after F1 was used to accept display as clock
adjustment. The adjustment factor is calculated and subsequently
the CWK 1A or CWK 2A will perform an automatic clock adjustment
using the latest value of adjustment factor.
The clock adjustment and accuracy measurement (display
adjustment, F1 and F8) can be repeated at a later date which will
improve the accuracy of the adjustment factor by averaging over a
greater length of time. The program does not allow the use of F8
before F5 and displays a warning.
OTHER UTILITIES AND FUNCTIONS
Under the Utilities menu are these functions:
The A key performs automatic system clock adjustment on
demand. This can be used if you want to compare the clock to a
time signal after the computer has been on for a long period of
time and its clock drifted by an appreciable amount.
The <D> key selects an easy to use days between dates
calculator. The entries in this calculator must be as shown,
either a three field date, or a one field number. Months must be
from 1 to 12, days from 1 to 31. Extra days added by mistake to
shorter months are regarded as days of the following month.
The <T> key provides for adjustments of all data in case
of time zone change and also provides handling of the date line.
<V> key shows contents of the data file translated into a
meaningful format, each item provided with a description. At the
bottom of the screen are the raw numbers and on the last line are
the present mode (-1 for standard, 0 for daylight, 2 for
universal and 6 for local meridian), time zone, longitude and the
command for retrieving the battery clock (type 1 only).
The Mode heading includes four selections: Standard
(winter) and Daylight (summer) are obvious. Standard is the
initial mode. While comparing to a time signal, use the
appropriate mode. Universal is identical to Standard until time zone is
entered under the menu heading Setup. Universal Time Coordinated
(UTC) formerly called Greenwich Mean Time, is the time for time
zone centered on the Greenwich meridian. Local Meridian is
identical to Universal until geographic longitude of interest is
entered in Setup. This option shows the time reference for use in
astronomy. Rise, transit and set of celestial bodies happen on
Local Meridian Time. These phenomena happen "on time" only in the
middle of time zones and when standard time is in use.
The Setup and Clock menu functions have already been
described in connection with other functions.
GENERAL NOTES
Once you start using this utility, do not set the clock
by using the DOS comands TIME and DATE or any other utility or
shell programs, since those adjustments would not be accounted
for. Also, for the same reason, do not adjust the battery clock
by the clock setting utility on type 1 systems. No matter how far
off the battery clock is, CLOCKWORK will adjust the system clock
correctly.
The adjustment factor (AF) is a number of seconds after
which one second correction is required. AF=7000 means that after
7000 seconds one second must be added. AF=-15000 means that after
15000 seconds one second must be subtracted.
There are no special system requirements and the program
works on any computer under the MS DOS or PC DOS operating
system. It cannot interfere with any other programs because it is
run only during system startup and when you want to initiate the
clock accuracy measurement or improve the adjustment factor.
If the system is on for many hours or days and it is only
the startup routine that invokes the adjustment, there will be no
automatic clock adjustment.
The program can be installed on a system with or without
a hard disk. Both files needed by CLOCKWORK can be placed on the
startup diskette and used as described.
It is possible to skip the invocations by AUTOEXEC.BAT
and use the program manually by typing CWK 1A or CWK 2A, while
the appropriate data files are accessible, or give the name of
the data file on the command line (like the description under
suggested setup) or use A option under Utilities.
The accuracy of the adjustment factor improves every time
the option F8 is used, since long term averaging takes place.
For best results use the option F5 only once but make
sure that the adjustment is really close to your reference. The
adjustment that is done just before using option F8 is less
critical because a small error in adjustment can be corrected
when repeating F8 and the averaging process will help more with
time.
The PC system clock was designed to give 18.2 ticks per
second. This clock granularity becomes clearly visible by running
a trivial BASIC program that prints TIMER$ repeatedly. The effect
of this is that setting the clock can be also done with limited
accuracy. This however does not affect significantly manual
inputs of corrections and long term averaging.
Following are some of the means for obtaining a time
signal. Short-wave radio WWV on 2.5, 5, 10, 15, 20 MHz or CHU on
3.33, 7.335, 14.67 MHz. Many short wave radio stations give time
signal on the hour (e.g. BBC World Service). WWV can be also
heard by telephone (303) 499-7111. The U.S. Naval Observatory,
Washington, D.C. time signal number is (202) 653-1800, or (900)
410-8463. Many areas have local telephone numbers that give exact
time, but the accuracy may not be always guaranteed. Many AM and
FM radio stations and TV stations come on air with extreme
accuracy and could be used as a time signal of sorts. Some of them
even give exact time explicitely.
There is one area where user feedback would be especially
welcome: I have encountered problems with the Real Time system
clocks on a few AT compatibles. Every time the machine is
rebooted, the clock looses somewhere between 1 and 3 seconds. It
is unpredictable and annoying. If you are running something that
occasionally locks up the machine and have to reboot, you lost
time in more than one sense of the word. (CLOCKWORK takes care of the
problem on average if you start the computer regularly. If you
leave the machine on all the time the problem is completely
eliminated, except if software or user action locks it up.) I
would like to find out if other users notice it and on what brand
system and with which brand of BIOS. Existence of the problem can
be confirmed easily without CLOCKWORK by using $t in the DOS
prompt and any wrist watch.
FINAL NOTE
This program is in the shareware domain, that means you
are encouraged to copy it for yourself, let anybody else copy or
pass on via bulletin boards, etc. Please keep both files together
for distribution.
If you decide to use this program on your system I would
like you to send me a user/registration fee of $15.- at the above
address. I will send you information about any new and improved
versions.
If either file is missing (CWK40.DOC or CWK.EXE) please
send $15.- plus $5.- for postage and handling. You will receive a
complete set of the latest version on a 360k diskette. The
upgrade cost for registered users is $15.- + $5.- P/H from
version 1.0, $5.- + $5.- P/H from version 2.0 and above. Postage
and handling is not applicable if you send a 360k DOS formatted
diskette and a self addressed stamped (75 cents) mailer.
If there is any feedback you might have about your
experience with this program or any suggestions, they are quite
welcome.